<?php include('includes/header.php'); 


?>
<script type="text/javascript">

$(document).ready(function(){

    jQuery("#formID").validationEngine();
    
    $('#tipoProducto').change(function() {
        var tipoproducto = $('#tipoProducto').val();
        $("#producto").val("");
        $("#prodId").val("");
        var proId        = 0;
        $("#producto").autocomplete({            
            source: "src/producto.php?modo="+6+"&tipoProducto="+tipoproducto+"&proId="+proId,
            minLength: 2,
            select: function(event, ui) {
                $("#prodId").val(ui.item.id);
            }
        });
    });
    $('#targetA').click(function() {
         if($('#formID').validationEngine('validate')){
             var tpoProducto    = $('#tipoProducto').val();
             var prodId         = $('#prodId').attr('value');
             var mes            =  $('#mes').val();
             var anno           =  $('#anno').val();
             $("#result-search").load('crProductoIndividual.php',  {tipoProducto: tpoProducto, prodId: prodId, mes: mes, anno: anno}, function(){
              
             });
            
         }
    });
});

</script>
<h1></h1>

<div class="z-form content-search" >
    <span class="title"> B&uacute;squeda </span>    
    <form id="formID">
        <div class="search">
         <div class="row">
            <div class="cell">
                <label for="prove"><span class="required">*</span>Tipo de Producto</label>        
                <select name="tipoProducto" id="tipoProducto" style="width: 200px">
                    <option value="-1">Seleccione:</option>
                    <option value="1">Materia Prima</option>
                    <option value="2">Producto Terminado</option>
                </select>
            </div>
            <div class="cell">
                <label><span class="required">*</span>Producto</label>
                <input name="producto" class="validate[ minSize[3],maxSize[150] text-input meddium" type="text"  id="producto" value=""/>
                <input type='hidden' id="prodId"  name="prodId" value="" />            
            </div>
            <div class="cell">
                <label for="mes">Mes</label>        
                <select name="mes" id="mes" style="">
                    <option value="-1">Seleccione:</option>
                    <option value="1">01</option>
                    <option value="2">02</option>
                    <option value="3">03</option>
                    <option value="4">04</option>
                    <option value="5">05</option>
                    <option value="6">06</option>
                    <option value="7">07</option>
                    <option value="8">08</option>
                    <option value="9">09</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                </select>
            </div>     
            <div class="cell">
                <label for="anno">Año</label>        
                <select name="anno" id="anno" style="">
                    <option value="-1">Seleccione:</option>
                    <option value="2010">2010</option>
                    <option value="2011">2011</option>
                    <option value="2012">2012</option>
                    <option value="2013">2013</option>
                    <option value="2014">2014</option>
                    <option value="2015">2015</option>
                    <option value="2016">2016</option>
                    <option value="2017">2017</option>
                    <option value="2018">2018</option>
                    <option value="2019">2019</option>
                    <option value="2020">2020</option>
                </select>
            </div>                  
         </div>
        </div>
        </br>
        </br>
        </br>
        </br>
        <a title="Aplicar B&uacute;squeda" id="targetA" > <img src="public/images/shared/search.gif"  align="middle"/> Buscar</a>            
    </form>
</div>
</br>
<div id="result-search">
</div>


<?php include('includes/footer.php'); ?>
